package com.cn.web.user.vo.member;

import com.cn.dic.annoations.DicAnnoations;
import com.cn.dic.serialize.DicSerialize;
import com.cn.web.user.vo.company.UserCompanyChangeEdit;
import com.cn.web.user.vo.company.UserCompanyDO;
import com.cn.web.user.vo.company.UserCompanyScoreDO;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * description: MemberApplyIEdit <br>
 * date: 23.7.20 14:39 <br>
 * author: cn_yaojin <br>
 * version: 1.0 <br>
 */
@Setter
@Getter
@Accessors(chain = true)
@ApiModel(value = "供应商入驻申请信息")
public class MemberApplyIEdit {

    @ApiModelProperty(value = "入驻身份，对应的数据字典：userItemType，为空则表示企业信息变更")
    private String userItemType;

    @ApiModelProperty(value = "企业基本信息")
    private UserCompanyDO companyBase;


    @Setter
    @Getter
    @Accessors(chain = true)
    public static class MemberCompanyChangeItem {

        /**
         * 0-企业信息库里面不存在，第一次申请
         * 1-企业信息已经存在库中，如果企业信息有变动，那么更改变动了的字段即可
         */
        @ApiModelProperty(value = "0-第一次申请 1-企业信息变更")
        private int type = 0;

        @ApiModelProperty(value = "入驻身份，对应的数据字典：userItemType")
        private String userItemType;

        @DicAnnoations(dicType = "userItemType")
        @JsonSerialize(using = DicSerialize.class)
        @ApiModelProperty(value = "入驻身份，对应的数据字典：userItemType")
        private String userItemTypeTxt;

        public String getUserItemTypeTxt() {
            return userItemType;
        }

        @ApiModelProperty(value = "企业基本信息")
        private UserCompanyDO companyBase;

        @ApiModelProperty(value = "企业信息变更对比")
        private List<UserCompanyChangeEdit.CompanyChangeItem> updateItem;

        @ApiModelProperty(value = "审批节点信息")
        private List<MemberCompanyAuditNode> approveItem;

        @ApiModelProperty(value = "业务ID")
        private String linkId;

        @ApiModelProperty(value = "审批任务 ID")
        private String runTaskId;

        @ApiModelProperty(value = "企业评分")
        private List<UserCompanyScoreDO> companyScore;

    }

    @Setter
    @Getter
    @Accessors(chain = true)
    @ApiModel(value = "企业审批节点信息")
    public static class MemberCompanyAuditNode {

        @ApiModelProperty(value = "节点名称")
        private String title;

        @ApiModelProperty(value = "节点ID")
        private String nodeId;

        @ApiModelProperty(value = "节点类型")
        private String nodeType;

        @ApiModelProperty(value = "节点执行人")
        private String taskUserName;

        @ApiModelProperty(value = "执行结果：0-未执行 1-通过 2-驳回")
        private String status;

        @ApiModelProperty(value = "审批意见")
        private String auditNote;

        @ApiModelProperty(value = "执行时间")
        private String updateTime;

        @ApiModelProperty(value = "附件")
        private Object auditFile;

    }

}
